
我們需要開啟XAMPP的MYSQL

這時候我們就能透過http://localhost/phpmyadmin/
進入phpMyAdmin,來使用我們的資料庫了

點選SQL就能輸入指令了

當然也別忘了按下執行
 📌 drop database if exists shop;
    create database shop default character set utf8 collate utf8_general_ci;
    grant all on shop.* to 'staff'@'localhost' identified by 'password';
    use shop;
可以把shop,改成想要的資料庫名稱
 📌  CREATE TABLE `user`
    (
       id int AUTO_INCREMENT PRIMARY KEY,
       uid varchar(255) not null,
       name varchar(255) not null,
       password varchar(255) not null
    );

新增資料表時,別忘了選擇資料庫

這樣就創建成功喽~
程式碼收錄:https://github.com/chyhhwen/shopping-system